package book_management.user.operation.impl;

import book_management.user.book.BookList;
import book_management.user.operation.IOperation;

public class ReturnOperation implements IOperation {
    @Override
    public void work(BookList bookList) {
        System.out.println("您现在进行的是书籍的归还操作");
        System.out.println("请输入您要归还的书籍名称：");
        String booksName=scanner.next();
        if(bookList.isContains(booksName)){
            if(bookList.isBorrowed(booksName)){
                //判断书籍的借阅状态
                bookList.bookReturn(booksName);
                System.out.println("书籍归还成功");
            }else{
                System.out.println("该书您没有借过，不用还哦~");
            }
        }else{
            System.out.println("该书不存在~~~");
        }
    }
}
